package com.example.okhp;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class ListVuewActivity extends Activity{
	ListView mymylistview;
	BaseAdapter mybase;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.listview);
		
		mymylistview = (ListView) findViewById(R.id.httplistview);	
		mybase=new BaseAdapter() {
			
			@Override
			public View getView(int arg0, View arg1, ViewGroup arg2) {
				// TODO Auto-generated method stub
				LayoutInflater inflater=LayoutInflater.from(ListVuewActivity.this);
				View myview=inflater.inflate(R.layout.mylistview, null);
					
				   TextView tv1= (TextView) myview.findViewById(R.id.name);
				   tv1.setText(sixListActivity.mylist.get(arg0).getBianhaoString());
				   TextView tv2= (TextView) myview.findViewById(R.id.fenshu);
				   tv2.setText(sixListActivity.mylist.get(arg0).getMingcheng());
				   TextView tv3= (TextView) myview.findViewById(R.id.mingc);
				   tv3.setText(sixListActivity.mylist.get(arg0).getFenshu());

				return myview;
			}
			
			@Override
			public long getItemId(int arg0) {
				// TODO Auto-generated method stub
				return 0;
			}
			
			@Override
			public Object getItem(int arg0) {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public int getCount() {
				// TODO Auto-generated method stub
				return sixListActivity.mylist.size();
			}
		};
		mymylistview.setAdapter(mybase);
	}

}
